<?php
/**
 * Created by PhpStorm.
 * User: EDZ
 * Date: 2020/6/22
 * Time: 14:41
 */

namespace DesignPatterns\Creative\AbstractFactory;
use utils\Str;

class ColorFactory extends AbstractFactory
{
    public function getColor(string  $color) : Color
    {
        if (empty($color)) {
            return null;
        }
        if (Str::equalsIgnoreCase($color, "RED")) {
            return new Red();
        } else if (Str::equalsIgnoreCase($color, "GREEN")) {
            return new Green();
        } else if (Str::equalsIgnoreCase($color, "BLUE")) {
            return new Blue();
        }
        return null;
    }

    public function getShape(string $shape) : Shape
    {
        return null;
    }
}